unzip_git:
  archive.extracted:
    - name: /opt/
    - source: /srv/files/git-git-v2.8.2-335-g4bb51ae.tar.gz
    - archive_format: tar
    - tar_options: xzvf
    - if_missing: /opt/git-git-g4bb51ae
    - unless: test -d /opt/git-git-g4bb51ae

install_git:
  cmd.run:
    - name: |
        cd /opt/git-git-g4bb51ae
        autoconf && ./configure --prefix=/usr/
        make && make install
        useradd git
        passwd git
        mkdir /home/git/git_home
        git config --global user.email "ifelse01@gmail.com"
        git config --global user.name "ifelse01"

create git example:
  cmd.run:
    - name: |
        mkdir /workspaces/HelloJava
        cd /workspaces/HelloJava
        git init
        echo "Hello, java project" > "ReadMe.md"
        git add *
        git commit -m 'initial project'
        cp -a .git/ /home/git/git_home/HelloJava.git

#ssh://git@192.168.11.11/home/git/git_home/HelloJava.git